<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改数据表配置')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-export-edit" th:object="${sqliteExport}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">数据库：</label>
                <div class="col-sm-8">
                    <select name="dbName" class="form-control m-b" th:with="type=${@dict.getType('db_generate_db_name')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{dbName}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">MYSQL表：</label>
                <div class="col-sm-8">
                    <input name="inputTable" th:field="*{inputTable}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">MYSQL查询：</label>
                <div class="col-sm-8">
                    <input name="inputSql" th:field="*{inputSql}" class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">SQLITE表：</label>
                <div class="col-sm-8">
                    <input name="outputTable" th:field="*{outputTable}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">MYSQL映射类：</label>
                <div class="col-sm-8">
                    <input name="inputClass" th:field="*{inputClass}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">SQLITE映射类：</label>
                <div class="col-sm-8">
                    <input name="outputClass" th:field="*{outputClass}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">转换类：</label>
                <div class="col-sm-8">
                    <input name="convertClass" th:field="*{convertClass}" class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">建表语句：</label>
                <div class="col-sm-8">
                    <textarea name="createSql" class="form-control" rows="6" >[[*{createSql}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">数据源：</label>
                <div class="col-sm-8">
                    <select name="datasource" class="form-control m-b" th:with="type=${@dict.getType('datasource_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{datasource}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "wenyanwen/export";
        $("#form-export-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-export-edit').serialize());
            }
        }

    </script>
</body>
</html>